#! /usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from optparse import OptionParser
from plane import Plane
from random import random
from math import sqrt

optparser= OptionParser()   
optparser.add_option('-n', dest='number',
					help='Number oj planes to generate',
					default=10)
options, args = optparser.parse_args(sys.argv[1:])

n = options.number
if not(len(n) > 0):
    sys.exit()
n=int(n)
for i in range(n):
    x = random()-.5
    y = random()-.5
    z = random()-.5
    len = sqrt(x**2+y**2+z**2)
    x = x/len
    y = y/len
    z = z/len
    a = Plane(0,0)
    a.define_by_normal_cos(x,y,z)
    sys.stdout.write("%i %i\n" % (a.dir, abs(a.dip)))
    
